<?php
// +----------------------------------------------------------------------
// | 海豚PHP框架 [ DolphinPHP ]
// +----------------------------------------------------------------------
// | 版权所有 2016~2017 河源市卓锐科技有限公司 [ http://www.zrthink.com ]
// +----------------------------------------------------------------------
// | 官方网站: http://dolphinphp.com
// +----------------------------------------------------------------------
// | 开源协议 ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------

namespace app\warehouse\validate;

use think\Validate;

/**
 * 承运商验证器
 * @package app\warehouse\validate
 * @author 陈梦晨 <2391157750@qq.com>
 */
class Carrier extends Validate
{
    //定义验证规则
    protected $rule = [
        'carriername|承运商名称' => 'require',
        'linkername|联系人名称' => 'require',
        'linkertel|联系人电话' => 'require',
        'carriercode|承运商代码' => 'require',
        'carriercode|承运商代码' => 'unique:admin_carrier,carriercode',
    ];

    //定义验证提示
    protected $message = [
        'carriername.require' => '承运商名称不能为空',
        'linkername.require' => '联系人名称不能为空',
        'linkertel.require' => '联系人电话不能为空',
        'carriercode.require' => '承运商代码不能为空',
        'carriercode.unique' => '承运商代码已经存在',
    ];
}
